package com.example.pceb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.pceb.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT COUNT(*) FROM user")
    int countAllUsers();

    @Select("SELECT identity, COUNT(*) as count FROM user GROUP BY identity")
    java.util.List<java.util.Map<String, Object>> countUserByIdentity();
}
